package com.icss.vo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.icss.common.vo.BasePojo;

/**
 * 博客的Pojo
 * 
 * @author 陈岩
 */
public class MakeupBlog extends BasePojo<MakeupBlog>
{
	private int id;
	private int usersId;
	private String name;
	private int upNum;
	private int downNum;
	private String content;
	private byte status;
	private Date createTime;
	private Date updateTime;

	private String statusStr;
	
	private MakeupUsers users ; 

	/*
	 * 方便枚举项在网页上显示出来 键为值(数字), 值为字符串描述 只提供get方法
	 */
	private Map<String, String> enumsMap = new TreeMap<String, String>();

	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		MakeupBlogEnum[] adminsEnums = MakeupBlogEnum.values();
		for (int i = 0; i < adminsEnums.length; i++)
		{
			MakeupBlogEnum adminsEnum = adminsEnums[i];
			String key = adminsEnum.toString();
			enumsMap.put(key + "-" + adminsEnum.getStatus() + "", adminsEnum.getName());
		}
		return enumsMap;
	}

	public String getStatusStr_Source()
	{
		if (this.status == 0)
		{
			this.statusStr = "禁用";
		} else if (this.status == 1)
		{
			this.statusStr = "启用";
		}
		return statusStr;
	}

	public String getStatusStr()
	{
		MakeupBlogEnum[] values = MakeupBlogEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			MakeupBlogEnum enumTemp = values[i];
			if (enumTemp.toString().startsWith("STATUS"))
			{
				if (enumTemp.getStatus() == this.status)
				{
					this.statusStr = enumTemp.getName();
				}
			}
		}

		return statusStr;
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public int getUsersId()
	{
		return usersId;
	}

	public void setUsersId(int usersId)
	{
		this.usersId = usersId;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public int getUpNum()
	{
		return upNum;
	}

	public void setUpNum(int upNum)
	{
		this.upNum = upNum;
	}

	public int getDownNum()
	{
		return downNum;
	}

	public void setDownNum(int downNum)
	{
		this.downNum = downNum;
	}

	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public MakeupUsers getUsers()
	{
		return users;
	}

	public void setUsers(MakeupUsers users)
	{
		this.users = users;
	}

}
